import { urlclearhashandsearch } from "./urlclearhashandsearch";

export function getabusoluteurl(
    rawurl: string,
    catalogueurl: string,
    baseurl: string
): string {
    if (rawurl.startsWith("/")) {
        return urlclearhashandsearch(String(new URL(rawurl.slice(1), baseurl)));
    } else {
        return urlclearhashandsearch(String(new URL(rawurl, catalogueurl)));
    }
}
